﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/PollMaster.Master" Inherits="System.Web.Mvc.ViewPage<GACFFP.VotingPeriod>" %>



<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">



<link type="text/css" href="/resources/css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />	
<script type="text/javascript" src="/resources/scripts/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="/resources/scripts/jquery-ui-1.8.16.custom.min.js"></script>

    <h2>Set Season Period</h2>

    <div class="callout">
    Current Season Start Date: <%=ViewData["SeasonStart"]%>
    <br />
    Current Season End Date: <%=ViewData["SeasonEnd"]%>
    <br />

    Allowed Days To Vote: 

     <% 
         var arrDays = (string[])ViewData["AllowedDaysToVote"];

         foreach (string thisSetDay in arrDays)
        {

            Response.Write(thisSetDay + ", ");
        
        }%>

    </div>

     <form id="form1" runat="server" action="UpdateSeason">

        

        <script>
            $(function () {
                $("#SeasonStart").datepicker();
            });

            $(function () {
                $("#SeasonEnd").datepicker();
            });

	    </script>

    
        Season Start: <input type="text" id="SeasonStart" name="SeasonStart" value=" <%=ViewData["SeasonStart"]%>" />
        <br />
        Season End: : <input type="text" id="SeasonEnd" name="SeasonEnd" value="<%=ViewData["SeasonEnd"]%>"/>
        <br />

        <table cellpadding="0" cellspacing="0" padding="0">



        <%
            string[] WeekDays = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
            var arrDays = (string[])ViewData["AllowedDaysToVote"];
            bool isDaySet = false;
            foreach (string thisDayOfWeek in WeekDays)
            {
                Response.Write("<tr valign='top'>");

                
                foreach (string thisSetDay in arrDays)
                {
                    if (thisSetDay == thisDayOfWeek) isDaySet = true;
                }
                
                %>

                <td >                   
                    <%= thisDayOfWeek %>
                    </td><td>
                    <input type="radio" name="dayOfWeek_<%= thisDayOfWeek %>" 
                    <%                     
                    if (isDaySet)
                    {
                        Response.Write("checked");
                    } 
                    %>
                    />
                 </td>
                
                </tr>
                <%
                    
                isDaySet = false;
            }
                 
            
            
            
        %>

        </table>


        <input type="submit" name="Update season" />

    </form>

</asp:Content>


